<?php

class MainMenu extends CI_Controller {

    public function __construct() {
        parent::__construct();

        $this->load->library('form_validation');
        
    }

    /**
     * Index Page for this controller.
     *
     * Maps to the following URL
     * 		http://example.com/index.php/welcome
     * 	- or -  
     * 		http://example.com/index.php/welcome/index
     * 	- or -
     * Since this controller is set as the default controller in 
     * config/routes.php, it's displayed at http://example.com/
     *
     * So any other public methods not prefixed with an underscore will
     * map to /index.php/welcome/<method_name>
     * @see http://codeigniter.com/user_guide/general/urls.html
     */
    public function index() {

        $data1 = array(
            "condicion" => $this->input->post("operacion"),
        );
        
        $this->form_validation->set_error_delimiters('<span class="mensaje-error">', '</span>');

        /*if ($this->form_validation->run('Menu') === FALSE) {
            $this->load->view('Menu/mMenu');
        } else {     */       
            $select = $this->input->post("Tabla");
            $operation = $this->input->post("operacion");
            $condicion = "Insertar" ;
           // if ($operation == "Insertar") {
                switch ($select) {
                    case "Bancos":
                        $this->load->view('dbwindows/Banco');
                        break;
                    case "Bandas":
                        $this->load->view('dbwindows/Banda');
                        break;
                    case "CatalogoDepartamento":
                        $this->load->view('dbwindows/Catalogo_Departamento');
                        break;
                    case "Cargos":
                        $this->load->view('dbwindows/Cargo');
                        break;
                    case "Condenas":
                        $this->load->view('dbwindows/Condena');
                        break;
                    case "Departamentos":
                        $this->load->view('dbwindows/Departamento');
                        break;
                    case "Detenidos":
                        $this->load->view('dbwindows/Detenido');
                        break;
                    case "Empleados":
                        $this->load->view('dbwindows/Empleado');
                        break;
                    case "Jueces":
                        $this->load->view('dbwindows/Juez');
                        break;
                    case "Sucursales":
                        $this->load->view('dbwindows/Sucursales');
                        break;
                    case "Vigilantes":
                        $this->load->view('dbwindows/Vigilante');
                        break;
                    default:
                         $this->load->view('Menu/mMenu');
                }
          /*  } else {
                switch ($select) {
                    case "Bancos":
                        $this->load->view('dbwindows/Banco');
                        break;
                    case "Bandas":
                        $this->load->view('dbwindows/Banda');
                        break;
                    case "Cargos":
                        $this->load->view('dbwindows/Cargo');
                        break;
                    case "Condenas":
                        $this->load->view('dbwindows/Condena');
                        break;
                    case "Departamentos":
                        $this->load->view('dbwindows/Departamento');
                        break;
                    case "Detenidos":
                        $this->load->view('dbwindows/Detenido');
                        break;
                    case "Empleados":
                        $this->load->view('dbwindows/Empleado');
                        break;
                    case "Jueces":
                        $this->load->view('dbwindows/Juez');
                        break;
                    case "Sucursales":
                        $this->load->view('dbwindows/Sucursal');
                        break;
                    case "Vigilantes":
                        $this->load->view('dbwindows/Vigilante');
                        break;
                    default:
                        echo "Error";
                } 
                
            }
        }*/
    }

    function validar() {
        
    }

}
